package com.act.demo.acitivitim4.enums;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * @description:
 * @author: liujin
 * @create: 2020-07-06 15:40
 */
public enum  TaskEnum {
    STUDENT_LEAVE("学生请假", "student"),
    PARENT_REVIEW("父母审核", "parent"),
    TEACHER_REVIEW("老师审核", "teacher"),
    ;


    private String taskName;

    private String taskKey;

    TaskEnum(String taskName, String taskKey) {
        this.taskName = taskName;
        this.taskKey = taskKey;
    }

    public String getTaskName() {
        return taskName;
    }

    public String getTaskKey() {
        return taskKey;
    }

    @JsonCreator
    public static TaskEnum fromValue(int index) {
        return values()[index];
    }

    @JsonValue
    public int toValue() {
        return this.ordinal();
    }
}
